home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The 640 MEG Shareware Studio 4
/
The 640 Meg Shareware Studio CD-ROM Volume IV (Data Express)(1994).ISO
/
clang
/
cujaug93.zip
/
1108114A
< prev
next >
Wrap
Text File
|
1993-06-09
|
334b
|
25 lines
/* swap2.c: A working swap function */
#include <stdio.h>
void swap(int *, int *);
main()
{
int i = 7, j = 8;
swap(&i,&j);
printf("i == %d, j == %d\n",i,j);
return 0;
}
void swap(int *xp, int *yp)
{
int temp = *xp;
*xp = *yp;
*yp = temp;
}
/* OUTPUT:
* i == 8, j == 7 */